package com.anlogic.sdk.ui.tests.uc9.programflash;

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import com.anlogic.sdk.ui.tests.utils.ProgramFlashUtils;
import com.anlogic.sdk.ui.tests.utils.ProgramFpgaUtils;
import com.anlogic.sdk.ui.tests.utils.WorkspaceUtils;

public class ph1p35_ProgramFlash_Test {
	private static SWTWorkbenchBot bot;

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {

		bot = new SWTWorkbenchBot();
		SWTBotPreferences.TIMEOUT = 10000;
		SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
		bot.waitUntil(Conditions.shellIsActive("data - FutureDynasty"), 60 * 1000);
		SWTBotPreferences.PLAYBACK_DELAY = 10;
		
	}

	@Before
	public void setUp() throws Exception {
		WorkspaceUtils.resetworkbench(bot);
	}

	@After
	public void tearDown() throws Exception {
		SWTBotView consoleView = bot.viewByPartName("Console");
	    consoleView.setFocus();
	    consoleView.show();
		bot.toolbarButtonWithTooltip("Clear Console").click();
		WorkspaceUtils.cleanWorkspace();
	}

	@Test
	public void ProgramFlash_ph1p35_Local_qspix1single_false_false_false_false_falseTest() throws InterruptedException {
		
		ProgramFlashUtils.programFlash(bot,"ph1p35","Local","D:\\AnlogicSDK\\resources\\BOOT.bin","","qspi-x1-single",false,false,false,false,false);
	}
	

	@Test
	public void ProgramFlash_ph1p35_Local_offset_qspix1single_false_false_false_false_falseTest() throws InterruptedException {
		
		ProgramFlashUtils.programFlash(bot,"ph1p35","Local","D:\\AnlogicSDK\\resources\\BOOT.bin","0x0","qspi-x1-single",false,false,false,false,false);
	}
	@Test
	public void ProgramFlash_ph1p35_Local_offset_qspix1single_true_false_false_false_falseTest() throws InterruptedException {
		
		ProgramFlashUtils.programFlash(bot,"ph1p35","Local","D:\\AnlogicSDK\\resources\\BOOT.bin","0x0","qspi-x1-single",true,false,false,false,false);
	}




	
	

	
	

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

}
